﻿<html lang="ch">
<head>
    <style type="text/css">[uib-typeahead-popup].dropdown-menu {
        display: block;
    }</style>
    <style type="text/css">.uib-time input {
        width: 50px;
    }</style>
    <style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow, [uib-tooltip-popup].tooltip.top-right > .tooltip-arrow, [uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow, [uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow, [uib-tooltip-popup].tooltip.left-top > .tooltip-arrow, [uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow, [uib-tooltip-popup].tooltip.right-top > .tooltip-arrow, [uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow, [uib-popover-popup].popover.top-left > .arrow, [uib-popover-popup].popover.top-right > .arrow, [uib-popover-popup].popover.bottom-left > .arrow, [uib-popover-popup].popover.bottom-right > .arrow, [uib-popover-popup].popover.left-top > .arrow, [uib-popover-popup].popover.left-bottom > .arrow, [uib-popover-popup].popover.right-top > .arrow, [uib-popover-popup].popover.right-bottom > .arrow {
        top: auto;
        bottom: auto;
        left: auto;
        right: auto;
        margin: 0;
    }

    [uib-popover-popup].popover, [uib-popover-template-popup].popover {
        display: block !important;
    }</style>
    <style type="text/css">.uib-datepicker .uib-title {
        width: 100%;
    }

    .uib-day button, .uib-month button, .uib-year button {
        min-width: 100%;
    }

    .uib-datepicker-popup.dropdown-menu {
        display: block;
        float: none;
        margin: 0;
    }

    .uib-button-bar {
        padding: 10px 9px 2px;
    }

    .uib-left, .uib-right {
        width: 100%
    }</style>
    <style type="text/css">.uib-position-measure {
        display: block !important;
        visibility: hidden !important;
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
    }

    .uib-position-scrollbar-measure {
        position: absolute;
        top: -9999px;
        width: 50px;
        height: 50px;
        overflow: scroll;
    }</style>
    <style type="text/css">.ng-animate.item:not(.left):not(.right) {
        -webkit-transition: 0s ease-in-out left;
        transition: 0s ease-in-out left
    }</style>
    <style type="text/css">@charset "UTF-8";
    [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak, .ng-hide:not(.ng-hide-animate) {
        display: none !important;
    }

    ng\:form {
        display: block;
    }

    .ng-animate-shim {
        visibility: hidden;
    }

    .ng-anchor {
        position: absolute;
    }</style>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1">
    <base href="/">
    <title page-title="">孝道乐龄</title>
    <meta name="fragment" content="!">

    <!-- Fav Icon -->
    <link href="" rel="shortcut icon" type="image/x-icon">

    <!-- Application CSS Files -->
    <link rel="stylesheet" href="/boss/css/bootstrap.css">
    <link rel="stylesheet" href="/boss/css/bootstrap-theme.css">
    <link rel="stylesheet" href="/boss/css/textAngular.css">
    <link rel="stylesheet" href="/boss/css/font-awesome.css">
    <link rel="stylesheet" href="/boss/css/aboutus.css">
    <link rel="stylesheet" href="/boss/css/chat.css">
    <link rel="stylesheet" href="/boss/css/core.css">
    <link rel="stylesheet" href="/boss/css/solutions.css">
    <link rel="stylesheet" href="/boss/css/users.css">
</head>

<body class="">
<!-- ngInclude: '/modules/core/client/views/header.client.view.html' -->
<header ng-include="'/modules/core/client/views/header.client.view.html'" class="warp ng-scope">
    <script type="text/javascript" src="/js/jquery-2.1.1.min.js"></script>

    <script language="javascript" type="text/javascript">
        $(function(){
            //回车事件
            document.onkeydown = function(e){
                var ev = document.all ? window.event:e;
                if(ev.keyCode === 13){
                    //登陆
                    login();
                }
            }

        });

        function IsPC() {
            var userAgentInfo = navigator.userAgent;
            var Agents = ["Android", "iPhone",
                "SymbianOS", "Windows Phone",
                "iPad", "iPod"];
            var flag = true;

            for (var v = 0; v < Agents.length; v++) {
                console.log("Agents.length is:",Agents.length);
                if (userAgentInfo.indexOf(Agents[v]) > 0) {
                    flag = false;
                    break;
                }
            }
            return flag;
        }


        function login(){
            var account = $('#account').val();
            var password = $('#password').val();

            if($('#account').val() == ''){
                alert('帐号不能为空!');
                $('#account').focus();
                return;
            }else if($('#password').val() == ''){
                alert('密码不能为空!');
                $('#password').focus();
                return;
            }
            //var isPc = IsPC();
           // localStorage.isPc = isPc;
        console.log("点击登入",account,password);
            // 发送数据至服务器
            $.ajax({
                url:'/doLogin',
                type:'POST',
                dataType:'json',
                data:{account:account, password:password},
                success:function(data){
                    if(data.code === 200){
                        //清除缓存的渠道选项
                        if(localStorage.channelInfoSelect)
                            localStorage.removeItem("channelInfoSelect")
                        var isAdmin = data.isAdmin;
                        window.location.href = '/boss/index';
                       /* if(isAdmin == 1){
                            window.location.href = "/userInfo/UserList";
                        }else{

                        }*/
                    }else{
                        alert('['+data.code+']:'+data.msg);
                    }
                    return;
                },error:function (err) {
                    console.log(333333333,err);
                }
            });
        }
    </script>

    <div ng-controller="HeaderController" class="ng-scope">
        <div class="warpbg" ng-show="$state.is('home')" style="">
            <div class="header navbar-hide" navbar="">
                <div class="container">
                    <div class="row">
                    </div>
                </div>
            </div>

            <div class="container" style="height: 93%">
                <div class="row">
                    <div class="header-mid">
                        <div class="title">
                              <h1 class="h2 text-light text-center push-top-bottom animation-pullDown">

                           <span>
                               <strong style="top: -1%">孝道乐龄后台管理中心</strong>
                           </span>
                            </h1>
                        </div>
                        <br>
                        <h4 class="smtitle">孝道</h4><br><br>
                        <div class="container  ng-scope" ui-view="">
                            <div class="col-xs-10  col-md-6 signbg ng-scope" style="top: 1%;">
                                <form   id="loginForm" name="vm.userForm" ng-submit="vm.signin(vm.userForm.$valid)" novalidate="" autocomplete="off"
                                        class="ng-pristine ng-invalid ng-invalid-required ">
                                    <fieldset>
                                        <div class="form-group" show-errors="">
                                            <input type="text" id="account" name="account"
                                                   class="form-control form-control-gray ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required"
                                                   ng-model="vm.credentials.username" placeholder="帐号" lowercase="" required=""
                                                   style="text-transform: lowercase;">

                                            <div ng-messages="vm.userForm.username.$error" role="alert" class="ng-active">
                                                <!-- ngMessage: required --><p class="help-block error-text ng-scope"
                                                                               ng-message="required">请填写帐号</p>
                                            </div>
                                        </div>
                                        <div class="form-group" show-errors="">
                                            <input type="password" id="password" name="password"
                                                   class="form-control form-control-gray ng-pristine ng-untouched ng-empty ng-invalid ng-invalid-required"
                                                   ng-model="vm.credentials.password" placeholder="密码" required="">

                                            <div ng-messages="vm.userForm.password.$error" role="alert" class="ng-active">
                                                <!-- ngMessage: required --><p class="help-block error-text ng-scope"
                                                                               ng-message="required">请填写密码</p>
                                            </div>
                                        </div>

                                        <div class="text-center form-group" style="button: 10%">
                                            <button type="button"  onclick="login()" class="btn btn-submit">登 录</button>
                                        </div>
                                        <!--          <div class="text-center form-group">
                                                      <a ui-sref="authentication.signup" href="/authentication/signup">注册</a>&nbsp;&nbsp;&nbsp;<a
                                                          class="sign-forget" ui-sref="password.forgot" href="/password/forgot">忘记密码?</a>
                                                  </div>-->
                                        <div class="text-center text-danger alert ng-isolate-scope alert-danger ng-hide"
                                             ng-class="['alert-' + (type || 'warning'), closeable ? 'alert-dismissible' : null]"
                                             role="alert" type="danger" ng-show="vm.error">
                                            <button ng-show="closeable" type="button" class="close ng-hide"
                                                    ng-click="close({$event: $event})">
                                                <span aria-hidden="true">×</span>
                                                <span class="sr-only">Close</span>
                                            </button>
                                            <div ng-transclude="">
                                                <span ng-bind="vm.error" class="ng-binding ng-scope"></span>
                                            </div>
                                        </div>
                                    </fieldset>
                                </form>
                            </div>
                        </div>

                    </div>
                </div>
            </div>
            <div style="TEXT-ALIGN: center;margin:0 auto;;">
            </div>
        </div>
    </div>
    </div>
</header>
